<?php
/**
 thinkclouds.net
**/
define('ALLOWGUEST',true);
require_once './source/core/run.php';
$tplfile = INDEX_TEMPLATE."user/user_reg.".$tplext;
$widgetfile = "./source/widget/user/user.php";
$action = Core_Fun::rec_post('action');
$url=Core_Fun::rec_post('url');
$mod = isset($_GET['mod']) ? $_GET['mod'] : "";

if($mod == "reset" || $mod == "cgpw" || $mod == "login"){
	//$tplfile = INDEX_TEMPLATE."page_guestbook_detail.".$tplext;
	$tplfile = INDEX_TEMPLATE."user/user_".$mod.".".$tplext;
}

if($action == 'modify'){
	$tplfile = INDEX_TEMPLATE."user/user_".$action.".".$tplext;
}

if(!Core_Fun::fileexists($tplfile)){
	Core_Fun::halt("对不起，模板文件“".$tplfile."”不存在，请检查！","",1);
}
if(!Core_Fun::fileexists($widgetfile)){
	Core_Fun::halt("对不起，部件文件“".$widgetfile."”不存在，请检查！","",1);
}

/* 缓存,模板处理 */
if($config['cachstatus']==1){
	$cache_seconds = $config['cachtime']*60;
	$tpl->setCaching(true); 
	$tpl->setCacheLifetime($cache_seconds);	
}
$cacheid = md5($_SERVER["REQUEST_URI"]);

if(Core_Fun::ischar($action)){
	require_once './source/module/app.php';
	require_once "./source/widget/user/user.php";
}
else{
	if(!$tpl->isCached($tplfile,$cacheid)){
	require_once './source/module/app.php';
	require_once "./source/widget/user/user.php";
	}
}
$tpl->assign("loginurl",$url);
$tpl->assign("runtime",Core_Fun::runtime());
$tpl->display($tplfile,$cacheid);
?>